/*
 * IContextDecorator.cpp
 *
 *  Created on: Apr 14, 2011
 *      Author: calle
 */

#include "IContextDecorator.h"

IContextDecorator::IContextDecorator(IContext* contex): m_context(contex) {

}

IContextDecorator::~IContextDecorator() {
	// Do not delete the m_Context since its a parent!!
}

bool IContextDecorator::addIdent(TypeEnum type, const Ident & ident)
{
	bool ret = false;
	if(m_context != NULL)
		ret = m_context->addIdent(type,ident);

	return ret;
}



bool IContextDecorator::identExists(const Ident & ident) const
{
	bool ret = false;
	if(m_context != NULL)
		ret = m_context->identExists(ident);

	return ret;
}



bool IContextDecorator::removeIdent(const Ident & ident)
{
	bool ret = false;
	if(m_context != NULL)
		ret = m_context->removeIdent(ident);

	return ret;
}



bool IContextDecorator::findType(const Ident& ident,TypeEnum& type)const
{
	bool ret = false;
	if(m_context != NULL)
		ret = m_context->findType(ident,type);

	return ret;
}

IContext *IContextDecorator::getParent() const
{

	return m_context;
}

void IContextDecorator::getAllOfType(TypeEnum type, IContext::TypeList & list) const
{
	if(m_context != NULL)
	{
		m_context->getAllOfType(type,list);
	}
}






